home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-06-07 | 2.6 KB | 63 lines | [TEXT/ttxt] |
- Settings File = TestBed
- Script Name = Do conv
- Command Key =
- F-key =
- Menu = YES
- Button = NO
-
- 1 Remark "This is the main script of the conversation package."
- 2 Remark "====================================="
- 3 Remark "Let 'InitConv' initialize the screen and variables."
- 4 Remark "====================================="
- 5 Do Script * "InitConv"
- 6 Remark "====================================="
- 7 Remark "This repeat loop is the heart of the conversation"
- 8 Remark "script. It watches the serial port and keyboard."
- 9 Remark "====================================="
- 10 Repeat
- 11 Remark "====================================="
- 12 Remark "Get the next key pressed if any."
- 13 Remark "====================================="
- 14 Set Variable inKey from Expression "=NEXTKEY"
- 15 Remark "====================================="
- 16 Remark "If a key was pressed handle it."
- 17 Remark "====================================="
- 18 If Expression "=Length(inKey) > 0"
- 19 Remark "====================================="
- 20 Remark "If the key is 'Esc' then set 'stopConv' to true."
- 21 Remark "====================================="
- 22 If Expression "=ASCII(inKey)=27"
- 23 Set Variable stopConv from Expression "=true"
- 24 Else
- 25 Remark "====================================="
- 26 Remark "Key is not 'Esc', so put it into 'keyboard' region."
- 27 Remark "====================================="
- 28 Do Script * "OutScroll"
- 29 Send Local to Screen "=inKey"
- 30 Send Text String "=inKey"
- 31 Remark "====================================="
- 32 Remark "If the key is 'CR' append a 'LF'."
- 33 Remark "====================================="
- 34 If Expression "=ASCII(inKey)=13"
- 35 Send Local to Screen "^J"
- 36 Send Text String "^J"
- 37 End If
- 38 Remark "====================================="
- 39 Remark "Restore 'conversation' region."
- 40 Remark "====================================="
- 41 Do Script * "InScroll"
- 42 End If
- 43 Else
- 44 Remark "====================================="
- 45 Remark "There was no key pressed, so let 'Wait' command"
- 46 Remark "service the serial port and write incoming"
- 47 Remark "characters to the 'conversation' region."
- 48 Remark "====================================="
- 49 Wait Sixtieths "20"
- 50 End If
- 51 Until Expression "=stopConv"
- 52 Remark "====================================="
- 53 Remark "Restore terminal screen to its normal state."
- 54 Remark "====================================="
- 55 Chain to Script "unInitConv"
-